/*
 * Created on Jul 21, 2005
 *
 */
package com.erclab.internal.xpresso.formelements;

import com.erclab.internal.xpresso.exceptions.FormException;
import com.erclab.internal.xpresso.forms.Form;

/**
 * @author Enrique Rodriguez.
 *
 */
public class HiddenUserId extends FormElement {

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#toHTML(com.erclab.internal.xpresso.forms.Form)
	 */
	public String toHTML(Form theForm) {
		return "<input type=\"hidden\" name=\"Field" + this.idFormElement + "\"" +
		"id=\"" + this.destinationColumn + " value=\"\">";
	}

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#loadLookupValues(com.erclab.internal.xpresso.forms.Form)
	 */
	public void loadLookupValues(Form theForm) throws FormException {
		// Nothing to do
	}

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#isModifiable()
	 */
	public boolean isModifiable() {
		return true;
	}
	

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#processSubmittedValues(java.lang.String[])
	 */
	public String[] processSubmittedValues(Form theForm, String[] submittedValues) {
		return new String[]{theForm.getFormParameters().getUser().getNetId()};
	}

	/* (non-Javadoc)
	 * @see com.erclab.internal.xpresso.formelements.FormElement#isHidden()
	 */
	public boolean isHidden() {
		return true;
	}

}
